<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"   
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:body>
        <h:form id="subArtForm">
            <p:panel header="Submit Article">
                <p:panelGrid columns="3"  styleClass="organisationGrid">
                    <h:outputText value="Name"/>
                    <h:inputText id="subArtName" value="#{submitArticleBean.name}" label="Name" required="true"></h:inputText>
                    <p:message for="subArtName"/>
                    <h:outputText value="Description"/>
                    <h:inputText id="subArtDesc" value="#{submitArticleBean.description}" maxlength="255" label="Description" required="true"></h:inputText>
                    <p:message for="subArtDesc"/>
                    <h:outputText value="Price"/>
                    <h:inputText id="subArtPrice" value="#{submitArticleBean.price}" label="Price">
                        <f:validateDoubleRange minimum="1" />
                        <f:convertNumber  type="currency"/>  
                    </h:inputText>
                    <p:message for="subArtPrice"/>
                    <h:outputText value="End of the auction"/>
                    <p:calendar id="subArtDate" value="#{submitArticleBean.endSale}"  mindate="#{submitArticleBean.minDate}" required="true"/>
                    <p:message for="subArtDate"/>
                    <p:selectCheckboxMenu  required="true" label="Category" value="#{submitArticleBean.selectedCategories}">
                        <f:selectItems value="#{submitArticleBean.categoriesValue}"/>
                    </p:selectCheckboxMenu>
                </p:panelGrid>
                <p:commandButton value="Sale" action="#{submitArticleBean.createArticle}" update=":contentGrid,:headerForm:growl"/>
            </p:panel>
        </h:form>
    </h:body>
</html>
